]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
slider: Extend the trough to the allocation extents
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 12 Jun 2013 03:33:54 +0000 (23:33 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 24 Jun 2013 19:14:03 +0000 (15:14 -0400)
This aligns the edge of the slider with the allocation of items
under it, which is what we want to happen in the new aggregate
menu.

https://bugzilla.gnome.org/show_bug.cgi?id=702825

js/ui/slider.js

index ba8b9f663f67ab90dbf98aa8a5c227da891dd090..534b3748b3382828b25c0e2441e4ee1d1a6d8317 100644 (file)
@@ -48,7 +48,6 @@ const Slider = new Lang.Class({
         let [hasHandleColor, handleBorderColor] =
             themeNode.lookup_color('-slider-handle-border-color', false);
 
-        let sliderWidth = width - 2 * handleRadius;
         let sliderHeight = themeNode.get_length('-slider-height');
 
         let sliderBorderWidth = themeNode.get_length('-slider-border-width');
@@ -64,7 +63,7 @@ const Slider = new Lang.Class({
             sliderActiveColor.green / 255,
             sliderActiveColor.blue / 255,
             sliderActiveColor.alpha / 255);
-        cr.rectangle(handleRadius, (height - sliderHeight) / 2, sliderWidth * this._value, sliderHeight);
+        cr.rectangle(0, (height - sliderHeight) / 2, width * this._value, sliderHeight);
         cr.fillPreserve();
         cr.setSourceRGBA (
             sliderActiveBorderColor.red / 255,
@@ -79,7 +78,7 @@ const Slider = new Lang.Class({
             sliderColor.green / 255,
             sliderColor.blue / 255,
             sliderColor.alpha / 255);
-        cr.rectangle(handleRadius + sliderWidth * this._value, (height - sliderHeight) / 2, sliderWidth * (1 - this._value), sliderHeight);
+        cr.rectangle(width * this._value, (height - sliderHeight) / 2, width * (1 - this._value), sliderHeight);
         cr.fillPreserve();
         cr.setSourceRGBA (
             sliderBorderColor.red / 255,